local HoleCell = class("HoleCell")

function HoleCell:ctor()
end

function HoleCell:start()
    self._panel:SetCallback(handler(self, self._onPanelClick))
end

function HoleCell:updateUI(data, selectedId)
    self._data = data
    self._textName.text = data.name
    self._textLevel.text = Lang.get("lang_tuijiandengji", {level = data.level})
    self._textDesc.text = data.desc
    self._imageSelected.gameObject:SetActive(selectedId == self._data.id)
end

function HoleCell:_onPanelClick(event)
    printDebug("HoleCell:_onPanelClick " .. event)
    if self.customCallback then
        self.customCallback(self, self._data.id)
    end
end

return HoleCell
